package com.ys.controller.web.storage;

import com.ys.config.MenuId;
import com.ys.entity.storage.TccPuton;
import com.ys.service.storage.TccPutonService;
import com.ys.service.sys.CommonApiService;
import com.ys.vo.W;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * 质检上架
 */
@Controller
@RequestMapping("/web/storage/tccPuton")
public class WebTccPutonController {
	private static final Logger logger = LoggerFactory.getLogger(WebTccPutonController.class);

	@Autowired
	private CommonApiService<TccPuton> commonApiService;

    @Autowired
    private TccPutonService tccPutonService;

    private final Long MENU_ID = MenuId.TCC_Puton;

    /*
     * 详情
     */
    @GetMapping("/toDetail")
    public String toDetail(Model model, HttpServletRequest request, HttpServletResponse response,Long id) {
        try {
            Map<String, Object> extraParam = tccPutonService.getInfoDetail(id);
            return commonApiService.toDetail(model,id, new TccPuton(), MENU_ID, extraParam, null);
        }catch (Exception e) {
            logger.error("详情页面出错：",e.getMessage(),e);
            return W.error(model, e.getMessage());
        }
    }


}






